%! (lenses.inc.ps) run

40 40 scale 0.01 setlinewidth 4 4 translate

newpath -0.25 1 moveto 0.25 1 lineto stroke

newpath -0.25 -1 moveto 0.25 -1 lineto stroke

newpath 0 1 moveto 0 -1 lineto stroke

newpath -0.25 -1 moveto -0.5 -0.5 -0.5 0.5 -0.25 1 curveto stroke

newpath 0.25 -1 moveto 0.5 -0.5 0.5 0.5 0.25 1 curveto stroke

newpath -1.25 -1 moveto -1.5 -0.5 -1.5 0.5 -1.25 1 curveto stroke

newpath 9.5 3 div 1 moveto 9.5 3 div -1 lineto 0 0.5 0.5 setrgbcolor stroke

/N 21 def /p0 [-2 0.9] def

N { newpath 1 0 0 setrgbcolor /v0 [1 0] def /n1 [0 0] p0 gradient normalized def

/v1 n1 v0 1.376 refraction def /p1 p0 v0 [1 0 5 4 div] line-intersection def

/v2 n1 v1 1.406 refraction def /p2 p1 v1 [1 0 0] line-intersection def

/p3 p2 v2 [1 0 -10.5 3 div] line-intersection def

p0 0 get p0 1 get moveto p1 0 get p1 1 get lineto p2 0 get p2 1 get lineto p3 0 get p3 1 get lineto /p0 [-2 p0 1 get 0.09 sub] def stroke } repeat

showpage